

% Distributions
Grids.DensityCutoff = 0.001 ; % For pdf truncation to avoid numerical issues

Params.m0 = 1 ;
Params.massloc = 1 ;             % Exogenous supply of locations

% tolerance

Grids.tolv     = 1e-3 ;
Grids.tolC     = 1e-2 ;
Grids.tolu     = 1e-2 ; 
Grids.maxit = 100 ;

% number of gridpoints and smoothing
Grids.Nx    = 250 ;
Grids.smooth  = 0.0 ;
Params.TailShiftZeta = 0.1 ; % Used to smooth fzeta

% more smoothing parameters
Grids.minL = 0.00 ;
Grids.minu = 0.005 ;
Grids.maxu = 0.995 ;
Grids.smooth = 0.0 ;
Grids.vmin = 1e-15 ;
Grids.vmax = 1e20 ;
Grids.vsmooth = 1 ;


% scaling parameters for bisection
Grids.ScaleFactorVLtop = 10 ;
Grids.ScaleFactorC = 10 ;
Grids.ScaleFactorEntry = 10 ;


% number of grid points for initial guess
Grids.Nv = 100 ;

% Construct grids
Grids.x   = Params.xL + ( Params.xU - Params.xL ) * linspace(0,1,Grids.Nx)'  ;

Grids.dx  = [ Grids.x(2:end) - Grids.x(1:(end-1)) ; Grids.x(end) - Grids.x(end-1) ] ;
Grids.logx = log( Grids.x ) ;
Grids.dlogx  = [ Grids.logx(2:end) - Grids.logx(1:(end-1)) ; Grids.logx(end) - Grids.logx(end-1) ] ;

Grids.fx  = exp( - ( log( Grids.x ) ).^2 ./ ( 2 * Params.stdx^2 ) ) ./ ( sqrt(2 * pi ) .* Params.stdx ) ...
              ./ Grids.x ; 

Grids.mx = Grids.fx .* Grids.dx ; Grids.mx = Params.massloc * Grids.mx / sum( Grids.mx ) ;





